import { BaseEntity } from "src/baseEntity";
import { System } from "src/system/system.entity";
import { UserSys } from "src/user/userSys.entity";
import { Column, Entity, JoinTable, ManyToMany, ManyToOne } from "typeorm";

export enum PaymentType {
    运营 = "运营",
    维护 = "维护",
    采购 = "采购",
    外包结算 = "外包结算",
    工资 = "工资",
}

@Entity("payment")
export class Payment extends BaseEntity {
    @ManyToOne(() => System)
    system: System

    @ManyToOne(() => UserSys)
    user: UserSys

    @Column()
    payUser: string

    @Column({ comment: "类别", type: "enum", enum: PaymentType })
    type: PaymentType

    @Column({ comment: "用途" })
    purpose: string

    @Column({ comment: "支付方式" })
    payment: string

    @Column({ comment: "是否报销", default: false })
    reimbursement: boolean

    @Column({ comment: "金额" })
    price: number

    @Column({ nullable: true })
    comment: string
}